#!/bin/bash
# date: Mon Aug  1 13:49:27 CST 2022
# author: xxr
while true
do
echo -e "下方可以通过输入数字来实现对防火墙的控制"
echo "1----开启防火墙"
echo "2----关闭防火墙"
read -p "请输入数字 " num
case $num in 
	0 ) 
		echo "Bye"
		break
		;;
	1 ) 
		systemctl start firewalld
		echo -e  "\e[32mstart!\e[0m"
		;;
	2)
		systemctl stop firewalld
		echo -e  "\e[32mstop!\e[0m"
		;;
	*)
		echo -e "\e[31m请按要求输入数字\e[0m"
esac
done
